package com.spring.example.rocket.config;

import org.springframework.context.annotation.Configuration;

/**
 * author: xiaochi
 * date: 2025/9/30
 */
@Configuration
public class ConsumerConfig {


    /**
     * 配置消费者监听器容器
     * 支持更复杂的配置，包括订阅表达式、消息模式等
     */
    /*@Bean
    @ConditionalOnProperty(prefix = "rocketmq.consumer", name = "enabled", havingValue = "true")
    public DefaultRocketMQListenerContainer defaultRocketMQListenerContainer() {
        DefaultRocketMQListenerContainer container = new DefaultRocketMQListenerContainer();
        container.setNameServer("${rocketmq.name-server}");
        container.setConsumerGroup("${rocketmq.consumer.group}");
        container.setTopic("${rocketmq.consumer.topic}");
        container.setSelectorExpression("${rocketmq.consumer.tag:*}");
        container.setConsumeMode(DefaultRocketMQListenerContainer.CONSUME_MODE_CONCURRENTLY);
        container.setConsumeThreadMax(Runtime.getRuntime().availableProcessors());
        container.setConsumeThreadMin(5);
        container.setConsumeMessageBatchMaxSize(1);
        container.setPullBatchSize(32);
        container.setPullInterval(1000);
        return container;
    }*/
}
